body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
    'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Box sizing reset */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Remove default list markers to avoid triangles in some modes */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

html,
body,
#app {
  height: 100%;
}

/* Ensure main layout fills viewport and scrolls inside content area */
#app,
.t-layout {
  height: 100vh;
}
.t-layout__content {
  height: 100%;
  overflow: auto;
}

/* Hide outer page scrollbar; content areas should manage their own scroll */
html, body {
  overflow: hidden;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
}

/* Consistent scrollbar styling */
* {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* Remove any list markers inside TDesign tab/nav components */
.t-tabs__nav, .t-tabs__nav * {
  list-style: none !important;
}

/* Remove any accidental native appearance on tab wrappers that may render arrows */
.t-tabs__nav-item,
.t-tabs__nav-item-wrapper,
.t-tabs__nav-item-text-wrapper {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
}

/* Hide possible markers */
.t-tabs__nav-item::marker,
.t-tabs__nav-item-wrapper::marker,
.t-tabs__nav-item-text-wrapper::marker {
  content: none;
}

/* Hide details/summary default markers if any present in templates */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }

/* Hide horizontal scrollbar visuals in tabs nav scroll area but keep scroll functionality */
.t-tabs__nav-scroll {
  scrollbar-width: none; /* Firefox */
}
.t-tabs__nav-scroll::-webkit-scrollbar {
  display: none; /* WebKit */
}

/* Hard-disable any pseudo elements that might inject shapes/triangles */
.t-tabs__nav-item::before,
.t-tabs__nav-item::after,
.t-tabs__nav-item-wrapper::before,
.t-tabs__nav-item-wrapper::after,
.t-tabs__nav-item-text-wrapper::before,
.t-tabs__nav-item-text-wrapper::after {
  content: none !important;
  display: none !important;
}

/* Stabilize inline alignment to avoid vertical jump when clicking */
.t-tabs__nav-item,
.t-tabs__nav-item-wrapper,
.t-tabs__nav-item-text-wrapper {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Prevent pointer interaction on any leftover decoration layers */
.t-tabs__nav-item::before,
.t-tabs__nav-item::after { pointer-events: none; }

/* Remove TDesign Tabs ink bar (could look like a small triangle/indicator in some envs) */
.t-tabs__bar {
  display: none !important;
}

/* Normalize active tab to avoid reflow/jump on click */
.t-tabs__nav-item.t-is-active,
.t-tabs__nav-item.t-is-top.t-is-active {
  font-weight: inherit !important;
  border: 0 !important;
  outline: 0 !important;
}

/* Stabilize text box metrics to prevent vertical movement */
.t-tabs__nav-item,
.t-tabs__nav-item-wrapper,
.t-tabs__nav-item-text-wrapper {
  line-height: 1.2; /* stable */
}

/* Force display and remove any residual list/bullet/triangle from UA styles */
.t-tabs__nav-item,
.t-tabs__nav-item-wrapper,
.t-tabs__nav-item-text-wrapper {
  display: inline-flex !important;
  list-style: none !important;
  list-style-type: none !important;
  background: transparent !important;
  background-image: none !important;
  outline: none !important;
  box-sizing: border-box;
}

/* Fix vertical jump by normalizing height/line metrics and using base transparent border */
.t-tabs__nav-item.t-size-m,
.t-tabs__nav-item-wrapper.t-size-m,
.t-tabs__nav-item-text-wrapper.t-size-m {
  min-height: 36px; /* approximate TDesign size-m, adjust if needed */
  line-height: 36px;
}
.t-tabs__nav-item {
  border-bottom: 2px solid transparent; /* reserve space to avoid jump */
}
.t-tabs__nav-item.t-is-active {
  border-bottom-color: currentColor; /* or use theme var if desired */
}

/* Scoped Tabs cleanup: apply to any container that wraps Tabs with class 'yh-tabs-clean' */
.yh-tabs-clean {
  /* Remove any default markers/indicators inside this scope */
  .t-tabs *::before,
  .t-tabs *::after {
    content: none !important;
    display: none !important;
  }

  /* Hide ink bar/indicator, we will manage active state ourselves */
  .t-tabs__bar,
  .t-tabs__nav-bar {
    display: none !important;
  }

  /* Normalize list/appearance and disable motion */
  .t-tabs *,
  .t-tabs__nav-item,
  .t-tabs__nav-item-wrapper,
  .t-tabs__nav-item-text-wrapper {
    list-style: none !important;
    -webkit-appearance: none;
    appearance: none;
    transition: none !important;
    transform: none !important;
    background: transparent !important;
  }

  /* Stabilize metrics to avoid vertical jump */
  .t-tabs__nav-item,
  .t-tabs__nav-item-wrapper,
  .t-tabs__nav-item-text-wrapper {
    display: inline-flex !important;
    align-items: center;
    vertical-align: middle;
    line-height: 1.2;
    box-sizing: border-box;
  }

  /* Reserve underline space to prevent height change */
  .t-tabs__nav-item {
    border-bottom: 2px solid transparent;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Default: no underline shown on active; use modifier to enable */
  .t-tabs__nav-item.t-is-active {
    border-bottom-color: transparent;
    font-weight: inherit;
    outline: 0;
  }

  /* Modifier: show underline on active when parent has --underline */
  &.yh-tabs-clean--underline {
    .t-tabs__nav-item.t-is-active {
      border-bottom-color: currentColor;
    }
  }
}

/* Eliminate motion: no transitions or transforms on tabs */
.t-tabs__nav-item,
.t-tabs__nav-item-wrapper,
.t-tabs__nav-item-text-wrapper {
  transition: none !important;
  transform: none !important;
}

/* Normalize padding so height stays constant when active */
.t-tabs__nav-item.t-size-m,
.t-tabs__nav-item-wrapper.t-size-m,
.t-tabs__nav-item-text-wrapper.t-size-m {
  padding-top: 0;
  padding-bottom: 0;
}

/* Remove focus outline jump */
.t-tabs__nav-item:focus,
.t-tabs__nav-item-wrapper:focus,
.t-tabs__nav-item-text-wrapper:focus {
  outline: none !important;
}

/* Avoid duplicate outer scroll while dialog is open; keep dialog body scrollable (scoped) */
.yh-dialog--scroll .t-dialog__body {
  max-height: calc(100vh - 200px);
  overflow: auto;
}

/* Globally hide TDesign default close button to eliminate stray triangles; we will use overlay/Esc/footer to close
   If any dialog needs a top-right close, render a custom one via header slot in that page only. */
.t-dialog__close {
  display: none !important;
}

/* Hard reset any UA/third-party artifacts in Dialog header to remove stray triangles */
.t-dialog__header,
.t-dialog__header * {
  list-style: none !important;
  background: transparent !important;
  border: 0 !important;
  outline: none;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.t-dialog__header *::before,
.t-dialog__header *::after,
.t-dialog__header *::marker {
  content: none !important;
  display: none !important;
}

/* Prevent body scroll from hijacking pointer interactions at top edge (scoped) */
.yh-dialog--scroll .t-dialog__body {
  overscroll-behavior: contain;
}

/* Hide number input spin buttons inside dialogs to avoid stray up/down triangles near header */
.t-dialog input[type="number"]::-webkit-outer-spin-button,
.t-dialog input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.t-dialog input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}

/* Also hide number input spin buttons globally to avoid residual triangles in any layout */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
}

/* Hide scrollbar arrows/buttons that may appear in some environments */
::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

/* ================= DateRangePicker scoped adjustments ================= */
/* Ensure suffix icon not clipped: shift left slightly and add right padding */
.yh-date-range {
  /* TDesign input container inside range picker */
  .t-date-range-picker .t-input,
  .t-date-range-input .t-input,
  .t-input {
    padding-right: 48px !important; /* extra room for suffix icon */
    box-sizing: border-box;
    overflow: visible; /* prevent clipping of suffix */
  }

  /* Suffix wrapper positioning and spacing */
  .t-date-range-picker .t-input__suffix,
  .t-date-range-input .t-input__suffix,
  .t-input__suffix {
    right: 6px !important; /* move a bit left from edge */
    margin-right: 0;
    width: 24px; /* reserve fixed space for icon */
    transform: translateX(0); /* neutralize unwanted shifts */
  }

  /* Icon itself */
  .t-date-range-picker .t-input__suffix .t-icon,
  .t-date-range-input .t-input__suffix .t-icon,
  .t-input__suffix .t-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
  }

  /* In some versions suffix sits inside __wrap; cover both */
  .t-date-range-picker .t-input__wrap .t-input__suffix,
  .t-date-range-input .t-input__wrap .t-input__suffix,
  .t-input__wrap .t-input__suffix {
    right: 6px !important;
  }

  /* Ensure the actual text field reserves space if inner padding is used */
  .t-date-range-picker .t-input__inner,
  .t-date-range-input .t-input__inner,
  .t-input__inner {
    padding-right: 48px !important; /* match container padding */
    font-size: 12px; /* make date text more compact */
  }

  /* Tighten the separator spacing to save width */
  .t-date-range-input__separator,
  .t-date-range-picker__separator,
  .t-date-picker__separator {
    margin: 0 4px !important;
  }
}
